package com;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.context.annotation.Bean;
import org.springframework.web.servlet.view.InternalResourceViewResolver;

/**
 * 启动核心类
 * @author yyq
 *
 */
@ServletComponentScan // 过滤器自动注册
@SpringBootApplication
public class MPApplication {

	public static void main(String[] args) {
		SpringApplication.run(MPApplication.class, args);
	}
	
	/**
	 * JSP配置
	 * @return
	 */
	@Bean
	public InternalResourceViewResolver viewResolver() {
	    InternalResourceViewResolver viewResolver = new InternalResourceViewResolver();
	    viewResolver.setPrefix("/WEB-INF/views/");
	    viewResolver.setSuffix(".jsp");
	    return viewResolver;
	}
	
}
